import { Module } from 'vuex'
import { ILoginState } from './types'
import { IRootState } from '../types'
import { accountLoginRequest } from '@/service/login/login'
import { IAccount } from '@/service/login/type'

const loginModule: Module<ILoginState, IRootState> = {
  namespaced: true,
  state: () => {
    return {
      token: '',
      userInfo: {}
    }
  },
  actions: {
    async loginAccountActions({ commit }, payload: IAccount) {
      const loginResult = await accountLoginRequest(payload)
      console.log(loginResult)
    }
  }
}
export default loginModule
